//根据相对路径获取完整路径
function getbaseurl(url){
	return basecontext+url;
}

//获取时间的string
function getdatestr(myDate){
	//获取当前年
	var year=myDate.getFullYear();
	//获取当前月
	var month=myDate.getMonth()+1;
	//获取当前日
	var day=myDate.getDate(); 
	var now=year+'-'+month+"-"+day;
	return now;
}


//表单数据转成json对象
function formtojson(formobj){
	 var o = {};
     var formvals = formobj.serializeArray();
     $.each(formvals, function() {
         if (o[this.name]) {
             if (!o[this.name].push) {
                 o[this.name] = [o[this.name]];
             }
             o[this.name].push(this.value || '');
         } else {
             o[this.name] = this.value || '';
         }
     });
     return o;
}
//获取图标
function geticonimg(picname,title,clickname){
	var s = getbaseurl("/common/images/icon64/"+picname);
	var cl = "";
	if(clickname){
		cl="onclick='"+clickname+"'";
	}
	var t = "<img src='"+s+"' width='20' height='20' title='"+title+"' "+cl+" style='cursor:pointer;float:left;'>";
	return t;
}
